<template>
	<view>
		<!-- <u-navbar :is-back='false' :border-bottom='false' :title='tit' title-color='#ffffff' :is-fixed='true'
			:background='background'>
			<view class="slot-wrap">
				<view @click="back"
					style="border-radius: 50%;width: 50rpx;height: 50rpx;background-color:rgba(0,0,0,.2);position: relative;">
					<text class="iconfont icon-xiangzuo"
						style="font-size: 40rpx;color: #FFFFFF;position: absolute;top: 50%;left: 50%;transform: translate(-50%,-50%);"></text>
				</view>

			</view>
		</u-navbar> -->
		<view style="width: 750rpx;height: 366rpx;background: linear-gradient(180deg, #1fb0ac 0%, #F5F5F5 100%);position: relative;">
			<view class="" style="padding-top: 50rpx;padding-bottom: 30rpx;">
				<view
					style="width: 92%;margin: 20rpx auto;box-sizing: border-box;padding: 30rpx;background-color: #FFFFFF;border-radius: 16rpx;">
					<view style="line-height: 80upx;color: #333333;font-size: 28rpx;height: 80rpx;">
						内容描述
					</view>
					<textarea maxlength="540"   placeholder="请输入内容描述(最多540字符)" v-model="content"
						style="width: 100%;height: 300rpx;line-height: 40rpx;font-size: 26rpx;" />
					<view class="upload">
						<view class="uploadimgcont">
							<view class="uploadimga" v-for="(item,index) in addimgArray_arr" :key="index">
								<view class="delete" @click="imgdelete(index)">
									<view class="deleteline">
									</view>
								</view>
								<image :src="item" mode="aspectFill"></image>
							</view>
							<view v-if="addimgArray_arr.length<9" class="uploadimg" @click="chooseImage">
								<image
									src="https://static-1310167831.cos.ap-nanjing.myqcloud.com/uploads/20220531/69aba21c7e2329034b458df0181cdc9f.png"
									style="border-radius: 12rpx;" mode=""></image>

							</view>
						</view>
					</view>
				</view>

				<view class="maincontent">
					<view class="input">
						<text class="fs28">联系人</text>
						<input class="fs28" style="text-align: right;" type="text"   placeholder="请输入联系人姓名" v-model="name" />
					</view>
					<view class="input justify-between" style="position: relative;">
						<text class="fs28">联系方式</text>
						<text class="fs28" v-if="mobile">{{mobile}}</text>
						<input v-else style="text-align: right;box-sizing: border-box" type="number" :disabled="true" placeholder="请完善个人信息联系方式"
							v-model="mobile" />
						<!-- <button class="shou" @getphonenumber="login1" style="background-color: #1fb0ac;color: #FFFFFF;position: absolute;top: 50%;right: 0;transform: translateY(-50%);"
							open-type="getPhoneNumber">授权手机号</button> -->
					</view>
					<!-- <view v-if="sf_phone" class="input" style="position: relative;">
						<text>验证码</text>
						<input style="text-align: right;padding-right: 200rpx;" type="text"
							placeholder="请输入验证码" v-model="code" />
						<button @click="huoqu" :disabled="disabled" type="default"
							style="font-size: 24rpx;color: #1fb0ac;position: absolute;top: 50%;right: 0;transform: translateY(-50%);">{{btnTitle}}</button>
					</view> -->
					<view class="input" style="position: relative;">
						<text class="fs28" style="width: 220rpx;">所在地</text>
						<view class="fs28" @click="jiage" style="flex: 1;color: #666666;font-size: 30rpx;text-align: right;">
							{{label2 || '请点击选择省市'}}
						</view>
						<!-- <input style="text-align: right;" type="text"
							placeholder="输入地址或点击选择" v-model="address" /> -->
						<!-- <image @click="address_xx"
							src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/address_rz.png"
							style="width: 60rpx;height: 60rpx;position: absolute;top: 50%;right: 0;transform: translateY(-50%);"
							mode=""></image> -->
					</view>
					<!-- <view class="input" style="position: relative;">
						<text>具体位置</text>
						<input style="text-align: right;padding-right: 80rpx;" type="text"
							placeholder="输入地址或点击选择" v-model="address" />
						<image @click="address_xx"
							src="https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/address_rz.png"
							style="width: 60rpx;height: 60rpx;position: absolute;top: 50%;right: 0;transform: translateY(-50%);"
							mode=""></image>
					</view> -->
					<view class="input">
						<text class="fs28">发布人身份</text>
						<!-- <input style="text-align: right;" type="text"   placeholder="收货人手机号" v-model="mobile"/> -->
						<view class="fs28" @click="handleTap('picker1')" style="flex: 1;text-align: right;">
							{{city1 || '请选择发布人身份'}}<text class="iconfont icon-xiangyou"></text>
						</view>
					</view>

					<view class="input" >
						<text class="fs28">产品分类</text>
						<!-- <input style="text-align: right;" type="text"   placeholder="收货人手机号" v-model="mobile"/> -->
						<view class="fs28" @click="xzcpfl" style="flex: 1;text-align: right;">
							请选择产品分类<text class="iconfont icon-xiangyou"></text>
						</view>
					</view>
					<view v-if="chanpin_list.length>0" style="overflow: hidden;margin: 20rpx 0;" >
						<view v-for="(item,index) in chanpin_list" :key='index' style="float: left;line-height: 60rpx;height: 60rpx;padding: 0 30rpx;margin: 10rpx;font-size: 26rpx;color: #333333;background-color: #F3F3F3;border-radius: 30rpx;display: inline-block;">
							{{item.name || ''}}
						</view>
					</view>
					<textarea v-if="zidingyi!=''"  :disabled='true' :maxlength='10' v-model="zidingyi" placeholder="请添加自定义产品分类(最多输入10个字)" placeholder-style="color:#666666;font-size:30rpx;" style="border-radius: 10rpx;line-height: 40rpx;color: #333333;font-size: 30rpx;background-color: #F1F1F1;box-sizing: border-box;padding: 20rpx;margin: 20rpx 0;height: 80rpx;width: 100%;" />
					<!-- <view class="input" style="border: none;">
						<text>帖子板块</text>
						<view @click="tzbk('picker3')" style="flex: 1;text-align: right;">
							{{bankuai || '请选择帖子板块'}}<text class="iconfont icon-xiangyou"></text>
						</view>
					</view> -->
					<view class="input" >
						<text class="fs28">帖子分类</text>
						<!-- <input style="text-align: right;" type="text"   placeholder="收货人手机号" v-model="mobile"/> -->
						<view class="fs28" @click="xzfl" style="flex: 1;text-align: right;">
							{{fenlei || '请选择帖子分类'}}<text class="iconfont icon-xiangyou"></text>
						</view>
					</view>
					<view v-if="pingguo_xian" class="moren">
						<label>
							<checkbox @click="ismoren" :checked="default1==1?true:false"
								style="transform:scale(0.7);color: #1fb0ac;" /><text>我已阅读并同意</text>
						</label>
						<text @click="fbxz" style="color: #1fb0ac;">⟪发布须知⟫</text>

					</view>

				</view>
				<button v-if="pingguo_xian" @click="queren" :disabled="fa_bu" style="width: 92%;margin: 30rpx auto 180rpx;background-color: #1fb0ac;height: 90rpx;line-height: 90rpx;color: #FFFFFF;text-align: center;border-radius: 45rpx;font-size: 30rpx;" type="default">确认发布</button>
			</view>
		</view>
		<lb-picker ref="picker1" v-model="city1" mode="selector" :dataset="{ name: city1 }" :list="list"
			@confirm="handleConfirm">
		</lb-picker>
		<lb-picker ref="picker6"
		  v-model="value2"
		  mode="multiSelector"
		  :list="list1"
		  :level="2"
		  :dataset="{ name: 'label2' }"
		  @confirm="handleConfirm4">
		</lb-picker>
		<uni-popup id="popup" ref="popup2" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					发布须知
				</view>
				<scroll-view scroll-y="true" style="height: 400rpx;margin-bottom: 20rpx;">
					<view style="line-height: 50rpx;color: #606266;font-size: 24rpx;" v-html="rule">

					</view>
				</scroll-view>
				<view @click="guan"
					style="width: 100%;height: 80rpx;line-height: 80rpx;background-color: #1fb0ac;border-radius: 40rpx;color: #FFFFFF;font-size: 30rpx;text-align: center;">
					确定
				</view>
			</view>
		</uni-popup>
		<uni-popup id="popup" ref="popup" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的用户信息</view>
				<view class="footer">
					<button @click="quxiao"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @click="login" lang="zh_CN" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getUserInfo">确定</button>
					<!-- <button @click="submitLink" type="default" class="submit">确认提交</button> -->
				</view>
			</view>
		</uni-popup>
		<uni-popup id="popup" ref="popup1" :type="type" :animation="true">
			<view class="" style="background-color: #FFFFFF;padding:20upx 30upx 0;border-radius: 20upx;width: 500rpx;">
				<view
					style="text-align: center;height: 100upx;line-height: 100upx;color: #333333;font-weight: 600;font-size: 32rpx;">
					提示
				</view>
				<view class="popup-content" style="text-align: center;font-size: 28upx;">请授权您的手机号</view>
				<view class="footer">
					<button @click="quxiao1"
						style="flex: 1;background-color: #f3f3f3;color: #333333;margin-right: 20rpx;font-weight: 600;"
						type="default">取消</button>
					<button @getphonenumber="login1" style="flex: 1;background-color: #000000;color: #FFFFFF;"
						open-type="getPhoneNumber">确定</button>

				</view>
			</view>
		</uni-popup>

		<lb-picker ref="picker3" v-model="bankuai" mode="selector" :dataset="{ name: bankuai }" :list="list3"
			@confirm="handleConfirm3">
		</lb-picker>

		<!-- <mrhardTabbar></mrhardTabbar> -->
		<noLoginToast ref="noLoginToast"/>
		<uploadImg ref="uploadImg" v-model="addimgArray_arr" permissionCameraContent="获取拍照权限是为了发布帖子" permissionAlbumContent="获取相册权限，是为了发布帖子" />
	</view>
</template>

<script>
	import areaData from '@/sub/pages/area-data-min1.js'
	import mrhardTabbar from "../../components/mrhard-tabbar.vue";
	// import QQMapWX from '@/common/qqmap-wx-jssdk.min.js'
	let qqmap;
	import LbPicker from '@/components/lb-picker'
	export default {
		components: {
			LbPicker,
			mrhardTabbar
		},
		data() {
			return {
				value2: [],
				label2: '',
				list1: areaData,
				background: {
					background: 'linear-gradient(180deg, #0078FF 0%, #1fb0ac 100%)'
				},
				tit: '',
				addimgArray_arr: [],
				pl_xs: 2,
				default1: 1,
				content: '',
				name: '',
				mobile: '',
				address: '',
				code: '',
				longitude: '',
				latitude: '',
				city: '',
				province:'',
				area:'',
				region: '',
				city1: '个人',
				list: [],
				id: '',
				btnTitle: "获取验证码",
				disabled: false,
				type: 'center',
				sf_phone: false,
				did: '',
				num: '',
				rule: '',
				yemc: '',
				zpzw: '',
				szhy: '',

				zd_list: [],
				xz: 'https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/54.png',
				wxz: 'https://frozen-info.oss-cn-shanghai.aliyuncs.com/uploads/miniapp/53.png',
				zd_type: 0,
				zd_status: 1,
				zf_list: ['微信支付', '积分支付'],
				status:1,
				post_id:'',
				xian:false,
				fa_bu:false,
				daid:'',
				id:'',
				id_list:[],
				fenlei:'',
				chanpin:'',
				chanpin_list:[],
				zidingyi:'',

				bankuai:'',
				yuan_list3:[],
				list3:[],
				bankuai_id:'',
				bianji_type:'',
				tzid:'',
				pingguo_xian:false,
			}
		},
		async onReady() {
			// qqmap = new QQMapWX({
			// 	// key: ‘PATBZ-EZURU-G***FU-GCBRO-LWFXC’
			// 	key: 'FOPBZ-BUOO4-5RZUS-DHXVW-EBIYJ-PDBSC'
			// });
			// this.address_xx()
			let isLogin = await this.$refs.noLoginToast.open()
			if (isLogin) {
				let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
				if (!isHasMobile) {
					return
				} else {
					this.mobile = uni.getStorageSync('mobile')
				}
			}
		},
		onPullDownRefresh() {

			setTimeout(function() {
				uni.stopPullDownRefresh();
			}, 1500);
		},
		onLoad(option) {
			// if(option){
			// 	this.daid=option.daid
			// 	this.id=option.id
			// }
			this.pingguo()
			this.bianji_type=option.type

		},
		// onHide(){
		// 	uni.removeStorageSync('tzid')
		// },
		async onShow() {
			this.user()
			this.tzbk_list()
			if(uni.getStorageSync('fb_type')==1){
				if(uni.getStorageSync('tzid')){
					this.tzid=uni.getStorageSync('tzid')
					this.tzxq()
				}

			}else{
				this.name = uni.getStorageSync('userinfo').name
				this.address = uni.getStorageSync('address')
				// this.content=''
				// this.addimgArray_arr=[]
				// this.daid=''
				// this.id=''
				// this.fenlei=''
				// this.chanpin=''
			}
			this.fa_bu=false
			this.longitude = uni.getStorageSync('longitude')
			this.latitude = uni.getStorageSync('latitude')
			console.log(this.daid,this.id)

		},
		methods: {
			jiage:function(){
				this.$refs['picker6'].show()
			},
			handleConfirm4 (e) {
			  // 如果存在多个picker，可以在picker上设置dataset属性，confirm中获取，就能区分是哪个picker了
			  console.log('confirm::', e)
			  if (e) {
			    // const name = e.dataset.name
			    this.label2 = e.item.map(m => m.label).join('-')
			    // if (name && label) {
			    //   this[name] = label
			    // }
			  }
			  this.province=e.item[0].label
			   this.city=e.item[1].label
			},
			// 获取用户信息
			user: function() {
				this.post('api/client/info', '', true).then(res => {
					console.log(res)
					if(res.code==1){
						if(res.data.firm_id!=''){
							this.list=['个人', '企业']
						}else{
							this.list=['个人']
						}
					}
				})
			},
			// 帖子板块
			tzbk:function(name){
				this.$refs[name].show()
			},
			// 帖子板块列表
			tzbk_list:function(){
				this.post('api/voice/special_type','',true).then(res=>{
					console.log(res)
					if(res.code==1){
						this.yuan_list3=res.data
						for(let i=0;i<res.data.length;i++){
							this.list3.push(res.data[i].title)
						}
					}
				})
			},
			handleConfirm3(e) {
				console.log(e)
				let index = e.index[0] || e.index
				this.bankuai = e.value
				this.bankuai_id=this.yuan_list3[index].id
			},
			// 选择分类
			xzfl:function(){
				if(this.id_list==''){
					uni.showToast({
						title: '请先选择产品分类',
						duration: 2000,
						icon: "none"
					})
					return
				}else{
					uni.navigateTo({
						url:'../../pages/index/fabu?type='+0+'&daid='+this.daid+'&fanwei_id='+this.id_list
					})
				}

			},
			xzcpfl:function(){
				uni.navigateTo({
					url:'../../pages/index/fabu1?type='+1+'&id='+this.daid+'&fanwei_id='+this.id_list+'&fanwei_list='+JSON.stringify(this.chanpin_list)+'&zidingyi='+this.zidingyi
				})
			},
			kaiqi:function(){
				let that=this
				uni.getSystemInfo({
				    success: function (res) {
				        console.log(res.model);
						let str = res.model
						console.log(str.indexOf("iPhone") != -1); // true
						that.post('api/post/isIosTop','',true).then(re=>{
							console.log(re)
							if(str.indexOf("iPhone") != -1){
								if(re.data==1){
									that.xian=true
								}else{
									that.xian=false
								}
							}else{
								that.xian=true
							}
						})

				    }
				});
			},
			zhiding: function() {
				this.post('api/post/post_top', '', true).then(res => {
					console.log(res)
					if (res.code == 1) {
						this.zd_list = res.data
					}
				})
			},
			zd_xz: function(index) {
				this.zd_type = index
			},
			// quxiao2: function() {
			// 	this.$refs.popup2.close()
			// 	this.pl_xs = 2
			// },
			// guanbi2: function() {
			// 	this.$refs.popup2.close()
			// 	this.$refs.popup3.open()
			// },
			// zdzf: function(index) {
			// 	this.zd_status = index + 1
			// },
			// quxiao3: function() {
			// 	this.$refs.popup3.close()
			// 	this.pl_xs = 2
			// },
			// guanbi3: function() {
			// 	this.$refs.popup3.close()
			// },


			// 浅到规则
			qiandao: function() {
				this.post('api/config/rule', '', true).then(res => {
					console.log(res)
					if (res.code == 1) {
						this.rule = res.data.post_publish_protocol
					}
				})
			},
			shiqu: function() {
				if (this.mobile != uni.getStorageSync('mobile')) {
					this.sf_phone = true
				} else {
					this.sf_phone = false
				}
			},
			fbxz: function() {
				uni.navigateTo({
					url: '/subpages/pages/rzxz?type=1'
				})
				// this.$refs.popup2.open()
			},
			guan: function() {
				this.$refs.popup2.close()
			},
			handleTap(name) {
				this.$refs[name].show()
			},
			handleConfirm(e) {
				console.log(e)
				let index = e.index[0] || e.index
				this.city1 = e.value
			},
			// 获取位置
			address_xx: function(index) {
				let that = this
				uni.authorize({
					scope: 'scope.userLocation',
					success() { //1.1 允许授权
						that.hqxxdd()
					},
					fail() { //1.2 拒绝授权
						uni.showModal({
							content: '检测到您没打开获取信息功能权限，是否去设置打开？',
							confirmText: "确认",
							cancelText: '取消',
							success: (res) => {
								if (res.confirm) {
									uni.openSetting({
										success: (res) => {
											console.log(res);
											that.hqxxdd()
										}
									})
								} else {
									console.log('取消');
									return false;
								}
							}
						})
						return false;
					}
				})
			},
			// 获取详细地址
			hqxxdd: function(e) {
				let that = this
				uni.chooseLocation({
					success: function(res) {
						console.log('位置名称：' + res.name);
						console.log('详细地址：' + res.address);
						console.log('纬度：' + res.latitude);
						console.log('经度：' + res.longitude);
						that.address = res.name
						that.longitude = res.longitude
						that.latitude = res.latitude
						qqmap.reverseGeocoder({
							location: {
								latitude: res.latitude,
								longitude: res.longitude
							},
							success: function(re) {
								console.log(re,111111111)
								that.province = re.result.address_component.province
								that.city = re.result.address_component.city
								// uni.setStorageSync('address', re.result.address)
								that.area = re.result.address_component.district; // 区
							},
							fail: function(res) {
								uni.showToast({
									title: '定位失败',
									duration: 2000,
									icon: "none"
								})
								console.log(res);
							},
							complete: function(res) {

							}
						})
						// that.city=res.address
					}
				});
			},
			back: function() {
				uni.navigateBack({
					delta: 1
				})
			},
			chooseImage() {
				this.$refs.uploadImg.open()
			},
			// 删除图片
			imgdelete(index) {
				// this.addimgArray.splice(index, 1)
				this.addimgArray_arr.splice(index, 1)
				// this.addimgArray.splice(index, 1)
			},
			//是否制定、、置顶
			plxs_switch1Change: function(e) {
				if (e.target.value) {
					this.pl_xs = 1
					this.$refs.popup2.open()
				} else {
					this.pl_xs = 2
				}
			},
			//设为默认
			ismoren() {
				if (this.default1 == 0) {
					this.default1 = 1
				} else {
					this.default1 = 0
				}
			},

			tzxq: function(id) {
				this.post('api/voice/info', {
					id:uni.getStorageSync('tzid')
				}, true).then(res => {
					if (res.code == 1) {
						this.content=res.data.main_content
						this.addimgArray_arr = res.data.main_images
						// this.mobile = res.data.mobile
						// if(this.mobile!=uni.getStorageSync('userinfo').mobile){
						// 	this.sf_phone=true
						// }
						this.name =  res.data.name
						// this.address = res.data.address
						if(res.data.type==2){
							this.city1='个人'
						}else{
							this.city1='企业'
						}
						this.bankuai_id=res.data.special_type
						this.bankuai=res.data.special_type_text
						this.city=res.data.city
						this.province=res.data.province
						this.label2 =this.province+'-'+this.city
						this.area=res.data.district
						this.fenlei=res.data.category.name
						this.daid=res.data.category.id
						this.id_list=res.data.voice_manage_id.split(',')
						for(let i=0;i<res.data.manage_data.length;i++){
							this.chanpin_list.push(
								{
									name:res.data.manage_data[i].one+'-'+res.data.manage_data[i].two,
									id:this.id_list[i]
								}
							)

						}

						this.zidingyi=res.data.search_field
						// this.chanpin=res.data.manage_data.one+'-'+
						// 			res.data.manage_data.two+'-'+
						// 			res.data.manage_data.three
						// this.id=res.data.voice_manage_id
						uni.removeStorageSync('tzid')
						// this.id = res.data.category_id
						// this.content = res.data.content
						// this.addimgArray_arr = res.data.images
						// this.name = res.data.name
						this.mobile = res.data.mobile
						this.address = res.data.address
						// this.longitude = res.data.longitude
						// this.latitude = res.data.latitude
						// this.city = res.data.region
						// this.num = res.data.number
						// this.yemc = res.data.company_name
						// this.zpzw = res.data.position_name
						// this.szhy = res.data.industry_name
						// this.did=res.data.pid
					}
				})
			},

			// 获取验证码
			huoqu: function() {
				if (this.mobile == '') {
					uni.showToast({
						title: '请获取手机号',
						icon: "none",
						duration: 1000
					})
					return
				} else if (!(/^1[3456789]\d{9}$/.test(this.mobile))) {
					uni.showToast({
						title: '请输入正确的手机号',
						icon: "none",
						duration: 1000
					})
					return
				} else {
					this.post('api/voice/mobile_change_code', {
						mobile: this.mobile
					}, true).then(res => {

						if (res.code == 1) {
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
							this.validateBtn()
						} else {
							uni.showToast({
								title: res.msg,
								icon: "none",
								duration: 1000
							})
						}
					})
				}

			},

			// 倒计时
			validateBtn() {
				//倒计时
				let time = 120;
				let timer = setInterval(() => {
					if (time == 0) {
						clearInterval(timer);
						this.disabled = false;
						this.btnTitle = "获取验证码";
					} else {
						this.btnTitle = time + '秒后重试';
						this.disabled = true;
						time--
					}
				}, 1000)
			},
			async queren() {
				let that=this
				let reg =/^1[3456789]\d{9}$/;
				let isLogin = await this.$refs.noLoginToast.open()
				if (isLogin) {
					let isHasMobile = await this.$refs.noLoginToast.getPhoneNumber()
					if (!isHasMobile) {
						return
					}
				} else {
					return
				}
				if(this.default1==0){
					uni.showToast({
						title:'请同意发布须知',
						icon: "none",
						duration: 1000
					})
					return
				}else if(!reg.test(this.mobile)){
					uni.showToast({
						title:'请输入手机号码',
						icon: "none",
						duration: 1000
					})
					return
				}else if(this.sf_phone){
					if(this.code==''){
						uni.showToast({
							title:'请输入验证码',
							icon: "none",
							duration: 1000
						})
						return
					}else if(!(/^[0-9]*$/.test(this.code))){
						uni.showToast({
							title:'请输入正确的验证码',
							icon: "none",
							duration: 1000
						})
						return
					}
				}
				this.qiu()
				return
				if(this.sf_phone){
					this.post('api/voice/check_mobile_change',{mobile:this.mobile,code:this.code},true).then(res=>{
						if(res.code==1){
							that.qiu()
						}else{
							uni.showToast({
								title: res.msg,
								duration: 1000,
								icon: 'none'
							});
						}
					})
				}else{
					this.qiu()
				}
			},
			qiu(){
				let that=this
				let a=''
				if(this.city1=='个人'){
					a=2
				}else{
					a=1
				}
				// console.log(this.content,123456666,this.addimgArray_arr.join(','))
				// return
				let shuju1 = {
					voice_category_id: that.daid,
					voice_manage_id:that.id_list.join(','),
					main_content: that.content,
					main_images: that.addimgArray_arr.join(','),
					name: that.name,
					mobile: that.mobile,
					type:a,
					address:that.address,
					longitude:that.longitude,
					latitude:that.latitude,
					code:that.code,
					search_field:that.zidingyi,
					city:this.city,
					province:this.province,

				}
				let shuju2={
					id:that.tzid,
					voice_category_id: that.daid,
					voice_manage_id:that.id_list.join(','),
					main_content: that.content,
					main_images: that.addimgArray_arr.join(','),
					name: that.name,
					mobile: that.mobile,
					type:a,
					address:that.address,
					longitude:that.longitude,
					latitude:that.latitude,
					code:that.code,
					search_field:that.zidingyi,
					city:this.city,
					province:this.province,
				}
				let data
				let url
				if(that.bianji_type==1){
					data=shuju2
					url='api/voice/edit'
				}else{
					data=shuju1
					url='api/voice/publish'
				}
				// console.log(that.bianji_type,url,123)
				// return
				that.fa_bu=true
				that.post(url, data, true).then(res => {
					console.log(res)
					if (res.code == 1) {
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
						uni.removeStorageSync('fb_type')
						setTimeout(function(){
							uni.switchTab({
								url:'../../pages/index/index'
							})
						},2000)
					} else if(res.code==201){
						that.post('api/pay/voice_pay',{voice_id:res.data.voice_id},true).then(pays=>{
							console.log(pays)
							if(pays.code==1){
								uni.getSystemInfo({
								    success: function (res) {
										let str = res.model
										console.log(str.indexOf("iPhone") != -1); // true
										that.post('api/index/wechat_check','',true).then(re=>{
											if(str.indexOf("iPhone") != -1){
												if(re.data==1){
													that.fukuan()
												}else{
													uni.showModal({
													    title: '温馨提示',
													    content: '由于相关规范，ios功能暂不可用！',
													    success: function (res) {
													        if (res.confirm) {

													        } else if (res.cancel) {

													        }
													    }
													});

												}
											}else{
												that.fukuan()
											}
										})

								    }
								});

							}else{
								that.fa_bu=false
								uni.showToast({
									title: res.msg,
									duration: 1000,
									icon: 'none'
								});
							}
						})
					}else {
						that.fa_bu=false
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
					}
				})
			},
			pingguo:function(){
				let that=this
				uni.getSystemInfo({
					    success: function (res) {
							let str = res.model
							console.log(str.indexOf("iPhone") != -1); // true
							that.post('api/index/wechat_check','',true).then(re=>{
								if(re.data==1){
									that.pingguo_xian=true
								}else{
									that.pingguo_xian=false
								}
								return
								if(str.indexOf("iPhone") != -1){
									if(re.data==1){
										that.pingguo_xian=true
									}else{
										that.pingguo_xian=false
									}
								}else{
									that.pingguo_xian=true
								}
							})

					    }
					});
			},
			fukuan:function(){
				let that=this
				uni.requestPayment({
					    provider: 'wxpay',
					    timeStamp: pays.data.timeStamp,
					    nonceStr: pays.data.nonceStr,
					    package: pays.data.package,
					    signType: pays.data.signType,
					    paySign: pays.data.paySign,
					    success: function (res) {
					      uni.showToast({
					      	title: '支付成功',
					      	icon: "none",
					      	duration: 1000
					      })
						 uni.removeStorageSync('fb_type')
						 setTimeout(function(){
						 	uni.switchTab({
						 		url:'/pages/index/index'
						 	})
						 },2000)
					    },

					    fail: function (err) {
							that.fa_bu=false
							uni.showToast({
								title: '您已取消支付',
								icon: "none",
								duration: 1000
							})
					        console.log(err);
					    }
				});
			},
			quxiao1: function() {
				this.$refs.popup1.close()
			},
			login1: function(e) {
				console.log(e)
				let that = this
				this.$refs.popup1.close()
				uni.login({
					provider: 'weixin',
					success: (code) => {
						console.log(code)
						this.post('api/wechat/phone', {
							code: code.code,
							iv: e.detail.iv,
							encryptedData: e.detail.encryptedData
						}, true).then(res => {
							console.log(res, '123455')
							if (res.code == 1) {
								that.mobile=res.data.phoneNumber
								uni.setStorageSync('mobile', res.data.phoneNumber)
								uni.setStorageSync('mobile2',res.data.mobile2)
							}else{
								uni.showToast({
									title: res.msg,
									icon: "none",
									duration: 1000
								})
							}

						})

					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.moren {
		display: flex;
		align-items: center;
		height: 120upx;
		text {
			font-size: 26upx;
			color: #666666;
		}

	}

	page {
		background-color: #f5f5f5 !important;
		font-family: Demibold;
		// padding-bottom:180rpx!important;
	}

	.slot-wrap {
		display: flex;
		align-items: center;
		/* 如果您想让slot内容占满整个导航栏的宽度 */
		/* flex: 1; */
		/* 如果您想让slot内容与导航栏左右有空隙 */
		padding: 0 30rpx;
	}

	.maincontent {
		width: 92%;
		margin: 0 auto;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		background-color: #FFFFFF;
		border-radius: 16rpx;

		.input {
			height: 100upx;
			width: 100%;
			box-sizing: border-box;
			padding: 30rpx 0;
			// margin-left: 40upx;
			border-bottom: 2upx solid #f0f0f0;
			display: flex;
			align-items: center;

			text {
				width: 176upx;
				font-size: 30upx;
				color: #333333;

			}

			input {
				flex: 1;
				font-size: 30upx;
				color: #333333;
			}
		}
	}

	// 上传图片
	.upload {
		// background: #FFFFFF;
		// padding: 0 40rpx;
		// height: 100vh;
		// height: 700upx;

		.title {
			font-size: 30rpx;
			font-weight: bold;
			color: #343434;
			padding-top: 15rpx;
		}

		.uploadimgcont {
			display: flex;
			// justify-content: space-between;
			flex-wrap: wrap;
			// margin-top: 50rpx;
			// margin:30upx 0 136upx;

			.uploadimga {
				width: 186rpx;
				height: 186rpx;
				margin-right: 24upx;
				margin-bottom: 40upx;
				position: relative;

				.delete {
					width: 40rpx;
					height: 40rpx;
					border-radius: 50%;
					background: #5093ff;
					display: flex;
					align-items: center;
					justify-content: space-around;
					position: absolute;
					top: -10upx;
					left: -10upx;
					z-index: 4;

					.deleteline {
						background: #FFFFFF;
						height: 5rpx;
						width: 50%;
					}
				}

				image {
					width: 100%;
					height: 100%;
				}
			}

			.uploadimg {
				width: 200rpx;
				height: 200rpx;
				background: #F9F9F9;
				border-radius: 14rpx;
				// overflow: hidden;
				position: relative;

				image {
					width: 100%;
					height: 100%;
				}

				view {
					position: absolute;
					bottom: 10rpx;
					left: 50%;
					width: 100%;
					text-align: center;
					transform: translateX(-50%);
					font-size: 28rpx;
					color: #404040;
				}
			}
		}

	}
	.footer {
		display: flex;
		justify-content: space-between;
		border-top: 1px solid #f4f4f4;
		margin-top: 30rpx;
		padding-bottom: 20rpx;

		button {
			margin: 0 auto;
			width: 100%;
			background-color: #19BE6B;
			// width: 200upx;
			border-radius: 10upx;
			font-size: $uni-font-size-sm;
			// padding: 22upx 34upx;
			height: 80upx;
			font-size: 30rpx;
			line-height: 80upx !important;
			// line-height: 1;
			color: #FFFFFF;
		}

		button:after {
			border: 0;
		}
	}
	.shou {
		margin: 0 auto;
		width: 160rpx;
		// width: 200upx;
		border-radius: 10upx;
		font-size: $uni-font-size-sm;
		// padding: 22upx 34upx;
		height: 60upx;
		font-size: 30rpx;
		line-height: 60upx !important;
		// line-height: 1;
		color: #FFFFFF;
		padding: 0;
		font-size: 26rpx;
	}

	.shou:after {
		border: 0;
	}
</style>
